<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY copy "&#169;">
  <!ENTITY nbsp "&#160;">
  <!ENTITY laquo "&#171;">
  <!ENTITY raquo "&#187;">
]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

    <!-- xsl:include href="../list.xsl"/ -->
    <xsl:include href="../newlist.xsl"/>

    <xsl:template match="/">
        <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="content">
        <link href="/js/jquery-ui/css/smoothness/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/js/jquery-ui/jquery-ui-1.8.18.custom.min.js"></script>
        <script type="text/javascript" src="/js/jquery-ui/jquery.ui.datepicker-uk.js"></script>
        <script type="text/javascript" src="/js/auction_address_select.js" />
        <style type="text/css">
            #datepicker_by_date, #datepicker_from, #datepicker_to {
            cursor: pointer;
            }
            .ui-widget {
            font-size: 0.7em !important;
            }
        </style>
        <style type="text/css">
            .ui-button-text {
            font: 8pt arial !important;
            }
        </style>
        <script type="text/javascript">
            $(function(){
            $("#datepicker_by_date").datepicker({
            onSelect: function(dateText, inst) {
            $('#datepicker_from, #datepicker_to').val('').datepicker('option', {minDate: null, maxDate: null});
            }
            });
            var dates = $("#datepicker_from, #datepicker_to").datepicker({
            numberOfMonths: 3,
            onSelect: function(selectedDate) {
            $('#datepicker_by_date').val('');
            var option = this.id == "datepicker_from" ? "minDate" : "maxDate",
            instance = $(this).data("datepicker"),
            date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
            dates.not(this).datepicker("option", option, date);
            }
            });
            $("#datepicker_from").datepicker("setDate", $("#datepicker_from").val());
            });
        </script>

        <xsl:call-template name="Head-List"/>

        <div class="aside">
            <div class="head-slide on">
                Фільтри
            </div>
            <div class="container">
                <form action="/{$Controller}" method="post" class="filter">
                    <fieldset>
                        <ul class="editlist">
                            <li>
                                <label>За датою</label>
                                <input name="by_date" value="{$Form/by_date}" id="datepicker_by_date" class="broad100" type="text" readonly="true" />
                            </li>
                            <li>
                                <label>Після вказаної дати</label>
                                <input name="from_date" value="{$Form/from_date}" id="datepicker_from" class="broad100" type="text" readonly="true" />
                            </li>
                            <li>
                                <label>До вказаної дати</label>
                                <input name="to_date" value="{$Form/to_date}" id="datepicker_to" class="broad100" type="text" readonly="true" />
                            </li>
                            <li>
                                <label>Область</label>
                                <select id="id_region" name="by_region" class="broad100">
                                    <xsl:if test="not($Form/id_region/row)">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                    <option value="0">
                                        -- Не вказано --
                                    </option>
                                    <xsl:for-each select="$Form/id_region/row">
                                        <option value="{id}">
                                            <xsl:if test="@active">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="name" />
                                        </option>
                                    </xsl:for-each>
                                </select>
                            </li>
                            <li>
                                <label>Район</label>
                                <select id="id_district" name="by_district" class="broad100">
                                    <xsl:if test="not($Form/id_district/row)">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                    <option value="0">
                                        -- Не вказано --
                                    </option>
                                    <xsl:for-each select="$Form/id_district/row">
                                        <option value="{id}">
                                            <xsl:if test="@active">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="name" />
                                        </option>
                                    </xsl:for-each>
                                </select>
                            </li>
                            <li>
                                <label>Населений пункт</label>
                                <select id="id_town" name="by_town" class="broad100">
                                    <xsl:if test="not($Form/id_town/row)">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                    <option value="0">
                                        -- Не вказано --
                                    </option>
                                    <xsl:for-each select="$Form/id_town/row">
                                        <option value="{id}">
                                            <xsl:if test="@active">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="name" />
                                        </option>
                                    </xsl:for-each>
                                </select>
                            </li>
                            <li>
                                <label>Статус</label>
                                <select name="by_status">
                                    <xsl:if test="not($Form/id_status/row)">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                    <option value="">
                                        Не вказано
                                    </option>
                                    <xsl:for-each select="$Form/id_status/row">
                                        <option value="{id}">
                                            <xsl:if test="@active">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="name" />
                                        </option>
                                    </xsl:for-each>
                                </select>
                            </li>
                            <li class="submit">
                                <input name="save" type="submit" id="save" style="font-weight: bold;" value="Застосувати" />
                                <input name="reset" type="submit" id="reset" value="Показати все" />
                            </li>
                        </ul>
                    </fieldset>
                </form>
            </div>
        </div>

        <div class="article">
            <div class="innerNav">
                <ul>
                    <li>
                        <a href="/{$Controller}" class="on">
                            <xsl:text>Аукціони</xsl:text>                            
                        </a>
                    </li>
                    <li>
                        <a href="/{$Controller}/lot-list">Лоти</a>
                    </li>
                </ul>
                <br class="spacer"/>
            </div>
            <div class="sort">
                <span>З виділеними:</span>
                <a href="javascript:;" id="auction_button_remove">Видалити</a>
                <a href="javascript:;" id="auction_button_status">На перевірку</a>
                <xsl:if test="$User/role_id = 12">
                <a href="javascript:;" id="auction_button_publish">Опублікувати</a>
                </xsl:if>
                
            </div>

            <input type="hidden" id="auctionid" name="auctionid" value="{$Main/@id}" />
            <input type="hidden" id="remove_auction_action" value="/{$Controller}/remove" />
            <!--xsl:apply-templates select="Main/List" /-->
            <xsl:call-template name="List">
					<xsl:with-param name="Node" select="Main/List"/>
					<xsl:with-param name="listName" select="'List'"/>
			</xsl:call-template>
        </div>

    </xsl:template>

</xsl:stylesheet>